<%@ page language="java" import="java.util.*" isELIgnored="false" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jsp/hadmin/commonHeader.jsp" %>
 
    <script src="./h/js/plugins/validate/messages_zh.min.js"></script>
    <script src="./plugin/jquery.form.min.js"></script>
	<script type="text/javascript">
	/* $.validator.setDefaults({
        highlight: function (element) {
            $(element).closest('.form-group').removeClass('has-success').addClass('has-error');
        },
        success: function (element) {
            element.closest('.form-group').removeClass('has-error').addClass('has-success');
        },
        errorElement: "span",
        errorPlacement: function (error, element) {
            if (element.is(":radio") || element.is(":checkbox")) {
                error.appendTo(element.parent().parent().parent());
            } else {
                error.appendTo(element.parent());
            }
        },
        errorClass: "help-block m-b-none",
        validClass: "help-block m-b-none"

    }); */
	
	//console.log(parent.iframes['${actionID}']);
	
	function onSubmit(form){
		if($(form).valid()){
			$(form).ajaxSubmit({
				"url":getCurrentUrl(formUrl),
				"dataType":"json",
				"toastMsg":true,
				onSuccess:function(message){
					//parent.layer.msg(message.message);
					try{
						parent.iframes['${actionID}'].$("#${actionID}Table").bootstrapTable("refresh")
					}catch (e) {
					}
					//parent.iframes['${actionID}'].refresh();
					parent.layer.close(parent.layer.getFrameIndex(window.name)); //再执行关闭   
				}
			});
		}
		return false;
	}
	</script>